﻿using System;
using JetBrains.Annotations;
using MugenInjection.Infrastructure;
using MugenInjection.Interface;

namespace MugenInjection.Web
{
    /// <summary>
    /// Class contain static instance of <see cref="IInjector"/>.
    /// </summary>
    [Obsolete("Use MugenInjectionHttpApplication.ApplicationConfiguration.Injector for access to IInjector.")]
    public static class InjectorContainer
    {
        #region Properties

        /// <summary>
        /// Gets or sets the <see cref="IInjector"/> that is used in the application.
        /// </summary>
        public static IInjector Injector
        {
            
            get
            {
                Validate.EnsureIsInitializedValue(MugenInjectionHttpApplication.ApplicationConfiguration, "MugenInjectionHttpApplication");
                return MugenInjectionHttpApplication.ApplicationConfiguration.Injector;
            }
        }

        #endregion
    }
}